/**
 * 
 */
package com.kandinfo.isbnmanage.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.kandinfo.base.common.dto.widget.DataTablesResponseDto;
import com.kandinfo.isbnmanage.dto.IsbnDealtReqDto;
import com.kandinfo.isbnmanage.dto.IsbnDealtResDto;
import com.kandinfo.isbnmanage.service.IsbnService;


/**
 * @author tangqh
 *
 */
@Controller
@RequestMapping(value = "/isbndealt")
public class IsbnDealtController {
	@Autowired
	private IsbnService isbnService;
	
	/**
	 * 购买列表
	 */
    @RequestMapping(value = "/buylist", method=RequestMethod.GET)
    public String buylist(Model model){
    	model.addAttribute("workType", "buy");
    	model.addAttribute("title", "ISBN购书和基本信息完善");
        return "isbnmanage/isbn_dealt_list";
    }
	/**
	 * 完善信息列表
	 */
    @RequestMapping(value = "/completelist", method=RequestMethod.GET)
    public String completelist(Model model){
    	model.addAttribute("workType", "complete");
    	model.addAttribute("title", "ISBN完善信息和上传图片");
        return "isbnmanage/isbn_dealt_list";
    }
    /**
	 * 审核发布列表
	 */
    @RequestMapping(value = "/publishlist", method=RequestMethod.GET)
    public String publishlist(Model model){
    	model.addAttribute("workType", "publish");
    	model.addAttribute("title", "ISBN信息审核和发布");
        return "isbnmanage/isbn_dealt_list";
    }
    
    @RequestMapping(value = "/searchIsbnDealtByCon", method = RequestMethod.POST)
    @ResponseBody
    public DataTablesResponseDto<IsbnDealtResDto> searchIsbnDealtByCon(@RequestBody IsbnDealtReqDto isbnDealtReqDto){
    	return isbnService.searchIsbnDealtByCon(isbnDealtReqDto);
    }
    
}